<?php
	$mes = '<p align="center" style="font-size:18px; font-weight:bold">PHIẾU ĐẶT HÀNG</p>';
	$mes .= '<table border="0px">';
	$mes .= '<tr>';
	$mes .= '<td>Họ Tên:</td>';
	$mes .= '<td><b>'.$hoten.'</b></td>';
	$mes .= '</tr>';
	$mes .= '<tr>';
	$mes .= '<td>Địa chỉ:</td>';
	$mes .= '<td><b>'.$diachi.'</b></td>';
	$mes .= '</tr>';
	$mes .= '<tr>';
	$mes .= '<td>E-Mail:</td>';
	$mes .= '<td><b>'.$email.'</b></td>';
	$mes .= '</tr>';
	$mes .= '<tr>';
	$mes .= '<td>Điện thoại: </td>';
	$mes .= '<td><b>'.$dienthoai.'</b></td>';
	$mes .= '</tr>';
	$mes .= '</table>';
	
	    $mes .= '<table width="100%" border="1px" cellpadding="2px" cellspacing="0px" style="border-collapse:collapse">';
		$index = 1;
		$total_money = 0;
		$mes .= '<tr bgcolor="#dadada" align="center" height="45" style="font-size:16px"><td><b>STT</b></td><td><b>Mã tranh</b></td><td><b>Tên tranh</b></td><td><b>Số lượng</b></td><td><b>Đơn giá</b><sup>(VNĐ)</sup></td><td><b>Thành tiền</b><sup>(VNĐ)</sup></td></tr>';
		foreach($CART->get_list_product() as $product)
		{
			$mes .= '<tr height="35px">';
			$mes .= '<td align="center">'.$index.'</td>';
			$mes .= '<td>'.$product->get_code().'</td>';
			$mes .= '<td>'.$product->get_name().'</td>';
			$mes .= '<td align="right">'.$product->get_quantity().'</td>';
			$mes .= '<td align="right">'.number_format($product->get_price(), 0, ',', '.').'</td>';
			$money = $product->get_price()*$product->get_quantity();
			$total_money += $money;
			$mes .= '<td align="right">'.number_format($money, 0, ',', '.').'</td>';
			$mes .= '</tr>';
			$index++;
			
		}
		$mes .= '<tr bgcolor="#f3f3f3" height="40px" style="font-size:16px"><td colspan="5" align="right" ><b>Tổng tiền*</b></td><td align="right"><b>'.number_format($total_money, 0, ',', '.').'</b></td></tr>';
		$mes .= '</table>';
		
?>